import request from "@/request";

/**
 * 创建队伍
 */
export function addTeam(data: any) {
  return request({
    url: "/team/add",
    method: "post",
    data,
  });
}
/**
 * 加入队伍
 */
export function joinTeam(data: any) {
  return request({
    url: "/team/join",
    method: "post",
    data,
  });
}
/**
 * 获取队伍列表
 */
 export function pageTeam(data: any) {
  return request({
    url: "/list/page",
    method: "post",
    params: data,
  });
}
/**
 * 获取全部队伍
 * @param query
 * @returns
 */
export function getTeamList(query: any) {
  return request({
    url: "/team/list",
    method: "get",
    params: query,
  });
}
/**
 * 获取我加入的队伍
 * @param query
 * @returns
 */
export function getTeamByJoin(query: any) {
  return request({
    url: "/team/list/my/join",
    method: "get",
    params: query,
  });
}
/**
 * 获取我创建的队伍
 * @param query
 * @returns
 */
export function getTeamByCreate(query: any) {
  return request({
    url: "/team/list/my/create",
    method: "get",
    params: query,
  });
}
/**
 * 根据id获取队伍信息
 * @param query
 * @returns
 */
export function getTeamById(data: any) {
  return request({
    url: `/team/get`,
    method: "get",
    params: data,
  });
}
export function updateTeam(data: any) {
  return request({
    url: `/team/update`,
    method: "post",
    data: data,
  });
}

export function quiteTeam(data: any) {
  return request({
    url: `/team/quite`,
    method: "post",
    data: data,
  });
}

export function deleteTeam(data: any) {
  return request({
    url: `/team/delete`,
    method: "post",
    data: data,
  });
}

